#define _GUN_SOURCE
#include "app_pool.h"
#include "log/log.h"
#include "unistd.h"
int task_fun(void *arg)
{
    log_debug("线程函数【%d】执行, 参数： %s",gettid(),(char *)arg);
    return 0;
}
int main(int argc, char const *argv[])
{
    // 初始化线程池
    app_pool_init(5);

    for (int i = 0; i < 10; i++)
    {
        char *buf = malloc(10);
        sprintf(buf,"%d",i);
        app_pool_registerTask(task_fun,buf);
    }
    sleep(1); //主线程休眠1s,等待子线程执行完毕

    // 销毁线程池
    app_pool_destroy();
    return 0;
}
